package com.ck.study;

/**
 * 静态代码块，静态方法，构造方法的执行顺序
 * 参看https://blog.csdn.net/qq_25615395/article/details/78294985
 */
public class StaticTest {

    static int age =1;
    int ageTwo = 2;

    static {
        System.out.println("这是静态块代码");
    }
    {
        System.out.println("这是普通代码块" + age);
    }

    public StaticTest() {
        System.out.println("这是构造方法");
    }
    public static void show() {
        System.out.println("这是静态方法");
    }

    public void fun() {
        System.out.println("这是普通方法");
    }

    public static void main(String[] args) {
        StaticTest t = new StaticTest();
        StaticTest.show();
        t.fun();
        String a = Boolean.toString(true);
        System.out.println(a);
    }

}
